package it.text.arr;


import java.util.Scanner;

public class text {
    public static void main(String[] args) {
        int[] arr = getIntsFROMSCANNER();
        int max = Max(arr);
        System.out.println("最高的成绩是："+ max);
    }

    private static int[] getIntsFROMSCANNER() {
        Scanner sc = new Scanner(System.in);

        int i=0;
        System.out.println("请输入一个班学生的人数，以及成绩:");
        i = sc.nextInt();

        int[] arr = new int[i];
        for (int j = 0; j <arr.length ; j++) {
            System.out.println("第"+(j+1)+"的成绩是:");
            arr[j] = sc.nextInt();
        }
        return arr;
    }

    public static int Max(int[] arr){
        int max = arr[0];

        for (int n = 0; n < arr.length; n++) {
            if (arr[n]>max)
                max = arr[n];
        }
        return max;
    }
}
